#include"../source/Socket.hpp"
#include<cassert>
int main(){
    Socket cli_sock;
    cli_sock.CreateClient(8888,"127.0.0.1");
    std::string req = "GET /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    req += "GET /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    req += "GET /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    int i=0;
    char buf[1024] = {0};
    
    while(1){
        assert(cli_sock.Send(req.c_str(), req.size()) != -1);
        std::cout<<"send1"<<std::endl;
        assert(cli_sock.Recv(buf,1023));
        std::cout<<buf<<std::endl;
        std::cout<<i++<<std::endl;
    }
    cli_sock.Close();
    
    return 0;
}